/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package amd.core;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Latiah Dwi Nurachma
 */
public class WriteToFileTxt {

    FileWriter fstream;
    BufferedWriter out;

    public WriteToFileTxt(String fileName) throws IOException {
        fstream = new FileWriter(fileName,true);
        out = new BufferedWriter(fstream);
    }

    public void write(String string){
        try {
            out.write(string);
        } catch (IOException ex) {
        }
    }

    public void writeln(String string){
        try {
            write(string);
            out.newLine();
        } catch (IOException ex) {
        }
    }

    public void close(){
        try {
            out.close();
        } catch (IOException ex) {
        }
    }
}
